'''
发送请求时，可以带请求头
比如自动化发的请求，user-agent为requests的版本号。可以伪装成浏览器发出去的请求。
'''

import requests

url = "http://192.168.150.33:8088/futureloan/mvc/api/member/register"
cs = {"mobilephone": "18012345678", "pwd": ""}
r = requests.get(url, params=cs)
print("请求头：", r.request.headers)

# 从fiddler抓到的包中拷贝一个
hd = {
    "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"}
r = requests.get(url, params=cs, headers=hd)
print("请求头：", r.request.headers)
